package com.dushibao.front.goods;

import com.dushibao.entity.Goods;
import com.dushibao.service.GoodsService;
import com.dushibao.service.impl.GoodsServiceImpl;
import com.dushibao.view.ModelAndView;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/goodsItem")
public class GoodsItemServlet extends HttpServlet {
    GoodsService goodsService = new GoodsServiceImpl();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        String id = req.getParameter("id");

        Goods goods = goodsService.getById(Long.parseLong(id));

        req.setAttribute("goods",goods);

        ModelAndView mv = new ModelAndView("goods/goodsItem");
    }
}
